package com.jt.controller;


import com.jt.pojo.Node;
import com.jt.service.ItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/item/cat")
public class ItemCatController {
    @Autowired
    ItemCatService itemCatService;


    @PostMapping("/list")
    @ResponseBody
    public List<Node> getCatList(Long id){
        return itemCatService.getItemCatNodeById(id);
    }


    @PostMapping("/queryItemName")
    @ResponseBody
    public String getItemNameById(Integer itemCatId){
        return itemCatService.getItemCatNameById(itemCatId);
    }
}
